<?php namespace module\photo;

use module\WfSite;

class Site extends WfSite {

	public function AdminIndex()
	{
		$this->display('index');
	}

	public function WebShow()
	{
		$this->display('show');
	}

	public function Webget() {
		$pos     = Request::get( 'pos' );
		$data    = Db::table( 'plugin_photo' )->where( 'id', '>=', $pos )->limit( 3 )->get();
		$num = Db::table('plugin_photo')->count();
		$tmp = $data?:[];
		$lastData = array_pop($tmp);
		if ($lastData) {
			$nops=$lastData['id'];
		}else{
			$nops=$pos-1;
		}
		ajax( [ 'data' => $data, 'pos' => $nops ,'num' => $num]);
	}
}
